package com.notice.rule.print;

import ch.qos.logback.classic.spi.ILoggingEvent;
import cn.hutool.core.date.DateUtil;
import com.notice.entity.NoticePrint;
import org.springframework.stereotype.Component;

/**
 * 头信息加工
 *
 * @author DZL
 * @date 2023/1/12 15:46
 */
@Component
public class HeadMsgProcess extends AbstractNoticeMsgProcessHandler {
    @Override
    public int order() {
        return -2;
    }

    @Override
    public NoticePrint printProcessing(ILoggingEvent event, NoticePrint noticePrint) {
        String sb = "系统时间：" + DateUtil.now() + "\n" +
                "线程名称：" + event.getThreadName() + "\n";
        noticePrint.setHeadMsg(sb);
        return noticePrint;
    }
}
